import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dictionary'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/news',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/News.vue'),
                    meta: { title: '新闻中心' }
                },
                {
                    path: '/dictionary',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/Dictionary.vue'),
                    meta: { title: '字典管理' }
                },
                {
                    path: '/user',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/user.vue'),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/tabs',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/FAQ.vue'),
                    meta: { title: '问题管理' }
                },
                {
                    path: '/addNews',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/news-add-or-update.vue'),
                    meta: { title: '新闻管理' }
                },
                {
                    path: '/charts',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/TeacherInfo.vue'),
                    meta: { title: '教师信息' }
                },
                {
                    path: '/student',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/StudentInfo.vue'),
                    meta: { title: '报名中心' }
                },
                {
                    path: '/photowall',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/PhotoWall.vue'),
                    meta: { title: '荣誉墙' }
                },
                {
                    path: '/upload',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/uploadFile.vue'),
                    meta: { title: '文件管理' }
                }

            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
